<template>
  <view
    class="about-us"
    :style="{ background: `url(${baseImgUrl}/commonImg/img_setting_bg.png)` }"
  >
    <nav-bar title="用户服务协议" backgroundColor="#115BAA" titleColor="#FFF"></nav-bar>
    <view class="know-box">
      <rich-text class="text" :nodes="serviceContent"></rich-text>
    </view>
  </view>
</template>

<script>
  import { baseImgUrl } from '@/config'
  import api_user from '@/api/user'
  export default {
    name: 'ServiceProtocol',
    data() {
      return {
        baseImgUrl,
        serviceContent: ''
      }
    },
    onLoad() {
      this.getDetail()
    },
    methods: {
      getDetail() {
        const params = {
          id: 10
        }
        api_user.fetchNewsDetail(params).then(res => {
          if (res.code !== 200) return
          this.serviceContent = res.data.content && res.data.content.replace(/\n/g, '<br/>')
        })
      }
    }
  }
</script>
<style lang="scss" scoped>
  .about-us {
    height: 100vh;
    .welcome-box,
    .know-box {
      padding: 40rpx 60rpx 0;
      font-size: 28rpx;
      line-height: 42rpx;
      text-align: justify;
      color: #808080;
    }
  }
</style>
